const net = require('net');
const server = net.createServer((socket) => {
    socket.write('hello');
    //客服端传递过来的
    socket.on('data', (chunk) => {
        console.log(chunk.toString());
    })
});

server.on('error', (err) => {
    throw err;
})
server.listen(80, () => {
    console.log('opend server on', server.address());
})